onbreak {resume}

# create library
if [file exists work] {
    vdel -all
}
vlib work

# compile source files
vlog sim12.v sim12_dp.v sim12_mem.v sim12_imem.v pipeline.v control.v sim12_tb.v

# start and run simulation
vsim -novopt work.stimulus 

view list
view wave

-- display input and output signals as hexidecimal values
# Diplays All Signals recursively
# add wave -hex -r /stimulus/*
add wave -noupdate -divider -height 12 "Simple12 Datapath"
add wave -hex /stimulus/dut/dp/*
add wave -hex /stimulus/dut/mem/RAM
add wave -noupdate -divider -height 12 "Simple12 Memory"
add wave -hex /stimulus/dut/imem/*
add wave -hex /stimulus/dut/mem/*
add wave -hex /stimulus/dut/imem/RAM
add list -hex -r /stimulus/*
add log -r /*


-- Set Wave Output Items 
TreeUpdate [SetDefaultTree]
WaveRestoreZoom {0 ps} {75 ns}
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2

-- Run the Simulation
run 120
